<!doctype html>
<html lang="ch">
<head>
    <title>思必达——学生</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">

    <!-- CSS ================================================== -->
    <link rel="stylesheet" href="assets/css/style.css">
    <link rel="stylesheet" href="assets/css/night-mode.css">
    <link rel="stylesheet" href="assets/css/framework.css">
    <!-- icons ================================================== -->
    <link rel="stylesheet" href="assets/css/icons.css">

    <!-- Google font
    ================================================== -->
    <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700" rel="stylesheet">
    <script src="assets/js/jquery-1.7.2.min.js"></script>
    <script src="/sybida/common/js/locahostadress.js" charset="utf-8"></script>
    <script src="/pdf/build/pdf.js" ></script>
    <style>
        #uploadd{
            display: inline-block;
            background-color:#2b542c;
            width: 100%;
            color:white;
            font-weight: 800;
            height: 40px;
            line-height: 40px;
        }
        #uploadd:hover{
            display: inline-block;
            background-color:  #FF9C05;
            width: 100%;color:white;
            font-weight: 800;
            height: 40px;
            line-height: 40px;
        }

    </style>
</head>

<body>

<!-- Wrapper -->
<div id="wrapper">
    <!-- header -->
    <div id="main_header">
        <header>


            <!--导航栏-->
            <!-- Logo-->
            <div id="logo">
                <a href="#" > <img src="assets/images/logo.png" alt=""></a>

                <a href="#"> <img src="assets/images/logo-light.png" class="logo-inverse" alt=""></a>
            </div>
            <div>
                <div class="mod-header">
                    <div class="layout-wrap">
                        <ul class="nav">
                            <li>
                                <a id="home" title=""class="btn-upgrade uk-visible@s">首页</a>
                            </li>


                            <li>
                                <a href="#" id="vitaeEvaluateStudent2" title="" class="nav_btn" >面试记录</a>
                            </li>

                            <li>
                                <a href="#" id="offerStudent2" title="" class="nav_btn" >offer记录</a>
                            </li>

                            <li>
                                <a href="#" id="vitae" title="" class="nav_btn" >查看简历评价</a>
                            </li>

                        </ul>

                    </div>
                </div>
            </div>



            <!--简历-->
            <!-- user icons -->
            <div class="head_user">
                <a href="#" class="btn-upgrade uk-visible@s" id="downfile"> <i class="uil-bolt-alt"></i> 预览已经上传简历</a>
                <script>
                </script>
                <a href="#" class="btn-upload uk-visible@s"> <i class="uil-cloud-upload"></i> 上传简历</a>
                <!-- upload dropdown box -->
                <div uk-dropdown="pos: top-right;mode:click ; animation: uk-animation-slide-bottom-small"
                     class="dropdown-notifications"  id="dropdown-notifications">
                    <!-- notivication header -->
                    <form action="" method="post" enctype="multipart/form-data" id="ff">
                        <div class="dropdown-notifications-headline">
                            <h4 style="height: 30px;line-height: 30px;font-size:16px;">上传简历方向
                                <select class="form-control" id="teachStudy" style="width: 150px;height: 20px;margin-left:20px;" >
                                </select>
                            </h4>
                        </div>
                        <!-- notification contents -->
                        <div class="dropdown-notifications-content uk-flex uk-flex-middle uk-flex-center text-center">
                            <div class="uk-flex uk-flex-column choose-upload  text-center">
                                <img src="assets/images/upload.png" width="70" class="m-auto" alt="">
                                <p class="my-3">简历建议使用 PDF 文件,文件大小不超过8M<br>
                                    如果你已经上传过简历，本次上传将会覆盖之前的简历..
                                </p>
                                <div uk-form-custom>

                                    <input type="file" id="filej" accept="application/pdf">
                                    <a href="#" class="button soft-warning small" id="chosefile">选择文件</a>
                                    <span id="showname"></span>
                                </div>
                            </div>
                            <script>

                                $("#filej").change(function(){
                                    var name1= document.getElementById('filej').files[0].name
                                    var new_value=name1
                                    if (name1.length > 20) {
                                        new_value = name1.substring(0, 15) + '......' + name1.substring(name1.length - 15, name1.length);
                                    }
                                    $("#showname").html(new_value)
                                })

                            </script>
                        </div>
                    </form>
                    <hr class="m-0">
                    <a onclick="uploadfile1()" id="uploadd4"><div  id="uploadd" class="text-center   " style="" > 确定上传
                    </div></a>
                </div>




                <!--信息-->
                <!-- videos feed  -->
                <!-- Message  notificiation dropdown -->
                <a href="../publicTool/receiveNotice.html" class="opts_icon" id="noticeTool" target="_blank"> <i class="uil-envelope-alt"></i> <span id="userinfonum">4</span> </a>





                <!-- profile -image    学生用户头像-->
                <a class="opts_account" id="studentPhoto1"> </a>
                <!-- profile dropdown  学生用户头像点击下拉框-->
                <div uk-dropdown="pos: top-right;mode:click ; animation: uk-animation-slide-bottom-small"
                     class="dropdown-notifications small">
                    <!-- User Name / Avatar -->
                    <a href="#">
                        <div class="dropdown-user-details">
                            <div class="dropdown-user-avatar" id="studentPhoto2">
                                <!--学生用户头像-->
                                <!--<img src="assets/images/avatars/avatar-1.jpg" alt="">-->
                            </div>
                            <!--学生姓名-->
                            <div id="studentName">
                            </div>
                        </div>
                    </a>
                    <!-- User menu -->
                    <ul class="dropdown-user-menu">
                        <li><a href="#" id="studentPersonalInformation"> <i class="uil-user"></i> 个人中心 </a> </li>
                        <li><a href="#" id="changePsw"> <i class="uil-bolt"></i> 修改密码</a> </li>
                        <li>
                            <a href="#" id="night-mode" class="btn-night-mode">
                                <i class="icon-feather-moon"></i> 夜间模式
                                <span class="btn-night-mode-switch">
                                        <span class="uk-switch-button"></span>
                                    </span>
                            </a>
                        </li>
                        <div class="menu-divider">
                            <li><a href="#" onclick="exittologin()"> <i class="icon-feather-log-out"></i> 退出登录</a>
                        </div>
                        </li>
                    </ul>
                </div>
                <script>
                    function exittologin(){
                        var userid=getCookie("userid")

                        console.log("+++"+userid)
                        $.ajax({
                            url: url+"login/exitlogin",
                            type: 'POST',
                            //   timeout: '30000',
                            data: "userid="+userid ,
                            // contentType: 'application/json;charset=utf-8',
                            dataType: 'json',
                            beforeSend: function(request) {
                                request.setRequestHeader("token", userid);
                            },
                            success: function () {

                            }
                        });
                        location.href="../login.html"
                    }
                </script>
            </div>

        </header>

    </div>
    <!-- contents -->
    <div class="main_content">
        <iframe src="/sybida/student/index/index.html" style="overflow: hidden;color: #2b542c" width="100%" id="ifream1" ></iframe>

        <script type="text/javascript">
            function reinitIframe(){
                var iframe = document.getElementById("ifream1");
                try{
                    var bHeight=0
                    var dHeight=0
                    bHeight = iframe.contentWindow.document.body.scrollHeight;
                    dHeight = iframe.contentWindow.document.documentElement.scrollHeight;
                    var height = Math.min(bHeight, dHeight);
                    iframe.height = height+100;
                }catch (ex){}
            }
            reinitIframe()
            window.setInterval("reinitIframe()", 200);
        </script>


        <!-- footer================================================== -->
        <div class="footer">
            <div class="uk-grid-collapse" uk-grid>
                <div class="uk-width-expand@s uk-first-column">
                    <p>© Sybida.com - 思必达网络公司</p>
                </div>
                <div class="uk-width-auto@s">
                    <nav class="footer-nav-icon">
                        <ul>
                            <li><a href="#"><i class="icon-brand-facebook"></i></a></li>
                            <li><a href="#"><i class="icon-brand-dribbble"></i></a></li>
                            <li><a href="#"><i class="icon-brand-youtube"></i></a></li>
                            <li><a href="#"><i class="icon-brand-twitter"></i></a></li>
                        </ul>
                    </nav>
                </div>
            </div>
        </div>
    </div>
</div>
<!--</div>-->
<!-- 转为夜间模式 -->
<script>
    (function (window, document, undefined) {
        'use strict';
        if (!('localStorage' in window)) return;
        var nightMode = localStorage.getItem('gmtNightMode');
        if (nightMode) {
            document.documentElement.className += ' night-mode';
        }
    })(window, document);


    (function (window, document, undefined) {

        'use strict';

        // Feature test
        if (!('localStorage' in window)) return;

        // Get our newly insert toggle
        var nightMode = document.querySelector('#night-mode');
        if (!nightMode) return;

        // When clicked, toggle night mode on or off
        nightMode.addEventListener('click', function (event) {
            event.preventDefault();
            document.documentElement.classList.toggle('night-mode');
            if (document.documentElement.classList.contains('night-mode')) {
                localStorage.setItem('gmtNightMode', true);
                return;
            }
            localStorage.removeItem('gmtNightMode');
        }, false);

    })(window, document);
</script>



<!-- javaScripts
            ================================================== -->
<script src="assets/js/framework.js"></script>
<script src="assets/js/jquery-3.3.1.min.js"></script>
<script src="assets/js/simplebar.js"></script>
<script src="assets/js/main.js"></script>

<script type="text/javascript" src="assets/js/nav.js"></script>
<script>
    var userid=getCookie("userid")
    function uploadfilepath(){

        $.post({
            url:url+"vitae/personalvitae",
            data:"userid="+userid+"&isDelete=1",
            beforeSend: function(request) {
                request.setRequestHeader("token", userid);
            },
            success:function (data) {
                if(data== -1000){
                    location.href=logindexurl
                }else {
                    if (data.message) {
                        // window.open( Qnyurl + data.message)
                        $("#downfile").attr("href", "../pdf/web/viewer.html?file="+Qnyurl + data.message)
                         $("#downfile").attr("target","_blank")
                          // $("#downfile").attr("download","aa")
                        $("#downfile").text(" 预览已经上传简历")
                    } else {
                        $("#downfile").text("从未上传过简历")
                    }
                }
            }});
    }
    uploadfilepath();
    $.getJSON({
        url:url+"/register/selectStudy",
        beforeSend: function(request) {
            request.setRequestHeader("token", userid);
        },
        success:function (data) {
            if(data== -1000){
                location.href=logindexurl
            }else {
                var html1 = ``
                for (var i = 4; i < data.length; i++) {
                    html1 += `<option value="${data[i].studyId}">${data[i].studyAspect}</option>`
                }
                $("#teachStudy").append(html1)
            }
        }})

    function uploadfile1() {
        $("#dropdown-notifications").attr("style","display:none;");
        var userid=getCookie("userid")
        var formData = new FormData(document.getElementById('ff'));
        formData.append("file", $("#filej")[0].files[0]);
        formData.append("studyid", $("#teachStudy").val() );
        formData.append("userid", userid);

        $.ajax({
            type: "post",
            url: url+"vitae/uploadvitae",
            data: formData,
            cache: false,   // 不缓存
            processData: false,   // jQuery不要去处理发送的数据
            contentType: false,   // jQuery不要去设置Content-Type请求头
            beforeSend: function(request) {
                request.setRequestHeader("token", userid);
            },
            success: function (data) {
                if(data== -1000){
                    location.href=logindexurl
                }else{
                    if(data.message){
                        $("#downfile").attr("href",Qnyurl+data.message)
                        $("#downfile").attr("download","aa")
                        $("#downfile").text(" 预览已经上传简历")
                    }else{
                        $("#downfile").text("从未上传过简历")
                    }
                    alert("上传成功")
                }
            },
            error:function () {
                alert("上传出错,请重试！！！");
            }
        });
    }
</script>

<script>
    window.onload = wOnload();
    //这是刷新浏览器执行的事件
    var storage = window.sessionStorage;
    iframeSrc = $("#ifream1").attr("src")
    storage.setItem("ifreamstudent",iframeSrc);

    function wOnload() {
        var storage = window.sessionStorage;
        var iframeSrc= storage.getItem("ifreamstudent");
        if(iframeSrc){
            $("#ifream1").attr("src",iframeSrc)
        }
        // console.log(iframeSrc)

    }
</script>


<script>

    $("#home").click(
        function () {
            $("#ifream1").attr("src","../student/index/index.html")
            iframeSrc = $("#ifream1").attr("src")
            var storage = window.sessionStorage;
            storage.setItem("ifreamstudent",iframeSrc);
        }
    )


    $("#studentAuditionRegister").click(
        function () {
            $("#ifream1").attr("src","../student/studentAuditionRegister.html")
            iframeSrc = $("#ifream1").attr("src")
            var storage = window.sessionStorage;
            storage.setItem("ifreamstudent",iframeSrc);
        }
    )


    $("#changePsw").click(
        function () {
            $("#ifream1").attr("src","../publicTool/changePsw.html")
            iframeSrc = $("#ifream1").attr("src")
            var storage = window.sessionStorage;
            storage.setItem("ifreamstudent",iframeSrc);
        }
    )


    $("#studentPersonalInformation").click(
        function () {
            $("#ifream1").attr("src","../student/studentPersonalInformation.html")
            iframeSrc = $("#ifream1").attr("src")
            var storage = window.sessionStorage;
            storage.setItem("ifreamstudent",iframeSrc);
        }
    )

    $("#vitaeEvaluateStudent2").click(
        function () {
            $("#ifream1").attr("src","../student/studentAudition.html")
            iframeSrc = $("#ifream1").attr("src")
            var storage = window.sessionStorage;
            storage.setItem("ifreamstudent",iframeSrc);
        }
    )



    $("#offerStudent").click(
        function () {
            $("#ifream1").attr("src","../student/studentPersonalOfferRegister.html")
            iframeSrc = $("#ifream1").attr("src")
            var storage = window.sessionStorage;
            storage.setItem("ifreamstudent",iframeSrc);
        }
    )

    $("#offerStudent2").click(
        function () {
            $("#ifream1").attr("src","../student/studentPersonalOffer.html")
            iframeSrc = $("#ifream1").attr("src")
            var storage = window.sessionStorage;
            storage.setItem("ifreamstudent",iframeSrc);
        }
    )



    $("#vitae").click(
        function () {
            $("#ifream1").attr("src","../student/studentVitae.html")
            iframeSrc = $("#ifream1").attr("src")
            var storage = window.sessionStorage;
            storage.setItem("ifreamstudent",iframeSrc);
        }
    )
</script>
<!--用户头像-->
<script>
    var userid=getCookie("userid")
    $.getJSON({
        url:url+"/user/userinfostu",
        data:"userid="+userid,
        beforeSend: function(request) {
            request.setRequestHeader("token", userid);
        },
        success:function (data) {
            if(data== -1000){
                location.href=logindexurl
            }else {
                var html = `<img src="${Qnyurl + data.data.studentPhoto}" alt="">`
                var html2 = `<div class="dropdown-user-name">${data.data.studentName}
                      <span> 已验证 <i class="uil-check"></i> </span>
                   </div>`
                $("#studentPhoto1").append(html)
                $("#studentPhoto2").append(html)
                $("#studentName").append(html2)
                $("#userinfonum").html(data.data.messageNum)

            }}})
</script>





</body>

</html>